<template>
  <div class="review_box">
    <div class="review_title">
      <span>浏览此商品的顾客也同时浏览</span>
    </div>
    <ul>
      <li
        v-for="(item, index) in goodDetail[0].reco_list"
        :key="index"
        @click="changeQueryFun(item.product_id)"
      >
        <img :src="item.image_url" />
        <div class="cont">
          <div class="goodsName">{{ item.name }}</div>
          <div class="tag">
            <span v-for="(i, j) in item.productTags" :key="j">{{
              i.name
            }}</span>
          </div>
          <div class="price">￥{{ item.price }}</div>
        </div>
      </li>
    </ul>
    <footerLink />
  </div>
</template>

<script>
import footerLink from "../../components/base/footerLink.vue";
export default {
  props: ["goodDetail"],
  components: {
    footerLink,
  },
  methods: {
    changeQueryFun(id) {
      this.$emit("changeActive",0)
      this.$router.replace({
        path: "/goodDetail",
        query: { id: id },
      });
    },
  },
};
</script>

<style lang="less" scoped>
.review_box {
  width: 100%;
  // height: 667px;
  position: absolute;
  top: 44px;
  left: 0;
  bottom: 0;
  background-color: white;
  // z-index: 8888;
  .review_title {
    height: 40px;
    line-height: 40px;
    background-color: white;
    margin-bottom: 3px;
    span {
      font-size: 12px;
      font-weight: bold;
      padding-left: 12px;
      border-left: 3px solid #000;
    }
  }
}
ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 3px;
  li {
    width: 49.5%;
    background-color: white;
    margin-bottom: 3px;
    img {
      width: 100%;
    }
    .cont {
      margin: 10px 10px 0;
      .goodsName {
        font-size: 13px;
        line-height: 18px;
        min-height: 36px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .price {
        display: block;
        float: left;
        color: #ff463c;
        font-size: 15px;
        line-height: 16px;
        margin-bottom: 8px;
      }
      .tag {
        width: 100%;
        // height: 22px;
        margin: 4px 0px;
        display: flex;
        span {
          display: inline-block;
          color: #fff;
          font-size: 12px;
          background-color: #fc5958;
          border-radius: 2px;
          border: 1px solid #fc5958;
          vertical-align: top;
          padding: 0 2px;
          margin-right: 4px;
          &:nth-child(1),
          &:nth-child(2) {
            background-color: white;
            color: #fc5958;
          }
        }
      }
    }
  }
}
</style>